﻿<UserControl
    x:Class="MobileServicesExample.SubscriberEditControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MobileServicesExample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400"
    d:DataContext="{Binding Source={d:DesignInstance local:SampleSubscribersViewModel, IsDesignTimeCreatable=True}, Path=SelectedSubscriber}">

    <Grid>
        <Grid.Resources>
            <local:GenderIsMatchValueConverter x:Name="IsMaleGenderConverter" TargetGender="Male"/>
            <local:GenderIsMatchValueConverter x:Name="IsFemaleGenderConverter" TargetGender="Female"/>
            <Style TargetType="TextBlock" BasedOn="{StaticResource BodyTextBlockStyle}">
                <Setter Property="Margin" Value="0, 0, 10, 0"></Setter>
            </Style>
            <Style TargetType="TextBox">
                <Setter Property="Margin" Value="0, 0, 10, 10"></Setter>
            </Style>
            <Style TargetType="RadioButton">
                <Setter Property="Margin" Value="0, 0, 10, 10"></Setter>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0" Text="Last Name: " />
        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding LastName, Mode=TwoWay}"/>
        <TextBlock Grid.Row="1" Grid.Column="0" Text="First Name: " />
        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding FirstName, Mode=TwoWay}"/>
        <TextBlock Grid.Row="2" Grid.Column="0" Text="Gender: " />
        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1">
            <RadioButton GroupName="Gender" Content="Male" IsChecked="{Binding Gender, Converter={StaticResource IsMaleGenderConverter}, Mode=TwoWay}"/>
            <RadioButton GroupName="Gender" Content="Female" IsChecked="{Binding Gender, Converter={StaticResource IsFemaleGenderConverter}, Mode=TwoWay}"/>
        </StackPanel>
        <TextBlock Grid.Row="3" Grid.Column="0" Text="Mailing Address: " />
        <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding MailingAddress, Mode=TwoWay}"/>
        <TextBlock Grid.Row="4" Grid.Column="0" Text="Phone Number: " />
        <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Phone, Mode=TwoWay}"/>
        <TextBlock Grid.Row="5" Grid.Column="0" Text="Email Address: " />
        <TextBox Grid.Row="5" Grid.Column="1" Text="{Binding EmailAddress, Mode=TwoWay}"/>
    </Grid>
</UserControl>
